import java.util.Date;
import java.io.*;

class ObjectOutputStreamTest {
    public static void main(String [] args) {
        Date d = new Date();
        try {
            FileOutputStream out = new FileOutputStream("date.txt");
            ObjectOutputStream oos = new ObjectOutputStream(out);
            oos.writeObject(d);
            oos.flush();
            oos.close();
        } catch (FileNotFoundException e) {

        } catch (IOException e) {

        }
    }
}
